﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="loginTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Log On
</asp:Content>

<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Log On</h2>
    <p>
        Please enter your username and password. <%= Html.ActionLink("Register", "Register") %> if you don't have an account.
    </p>
    <%= Html.ValidationSummary("Login was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm()) { %>
        <div>
            <fieldset>
                <legend>Account Information</legend>
                <p>
                    <label for="username">Username:</label>
                    <%= Html.TextBox("username") %>
                    <%= Html.ValidationMessage("username") %>
                </p>
                <p>
                    <label for="password">Password:</label>
                    <%= Html.Password("password") %>
                    <%= Html.ValidationMessage("password") %>
                </p>
                <p>
                    <%= Html.CheckBox("rememberMe") %> <label class="inline" for="rememberMe">Remember me?</label>
                </p>
                <p>
                    <input type="submit" value="Log On" />
                </p>
            </fieldset>
        </div>
    <% } %>
    
    <% using (Html.BeginForm(new { Controller = "Account", Action = "Authenticate" }))
       { %>         
         <fieldset >                             
         <div class="containercontent" >
             <div class="labelheaderblock">Log on using OpenId:</div>
             <input id="openid_identifier" name="openid_identifier"/>             
             <input id="btnOpenIdLogin" type="submit" value="Login"/>        
             <img id="imgOpenIdLoginProgress" src="<%= ResolveUrl("~/css/images/loading_small.gif") %>" style="display:none" />                 
             
            <div id="divOpenIdIcons">
                 <img src="../../Content/Images/openId-icon.png" onclick="openIdUrl('openid')" title="myopenid.com" class="hoverbutton" />
                 <img src="../../Content/Images/google-icon.png" onclick="openIdUrl('google')" title="Google" class="hoverbutton"/>
                 <img src="../../Content/Images/yahoo-icon.png" onclick="openIdUrl('yahoo')" title="Yahoo" class="hoverbutton" />
             </div>     
         </div>
         </fieldset>
<% } %>   

<script type="text/javascript">
  function openIdUrl(site) {
    var value = "";
    var autoClick = false;

    if (site == "openid") {
      value = "<Your Account>.myopenid.com"
    }
    else if (site == "google") {
      value = "https://www.google.com/accounts/o8/id";
      autoClick = true;
    }
    else if (site == "yahoo") {
      value = "http://yahoo.com/"
      autoClick = true;
    }

    if (value) {

      var jText = document.getElementById("openid_identifier");
      jText.value = value;
      jText.focus();
    }
  }
</script>

  <iframe
     id="WebAuthControl"
     name="WebAuthControl"
     src="http://login.live.com/controls/WebAuthLogo.htm?appid=<%=ViewData["AppId"]%>&style=font-size%3A+10pt%3B+font-family%3A+verdana%3B+background%3A+white%3B"
     width="80px"
     height="20px"
     marginwidth="0"
     marginheight="0"
     align="middle"
     frameborder="0"
     scrolling="no">
 </iframe>
</asp:Content>
